package com.sky.mapper;

import com.sky.annotation.AutoFill;
import com.sky.entity.SetmealDish;
import com.sky.enumeration.OperationType;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface SetmealDishMapper {

    /**
     * 根据菜品id 查套餐的id
     * @param dishIds
     * @return
     */
    List<Long> getSetmealIdsByDishIDs(@Param("dishIds") List<Long> dishIds);

    /**
     * 添加和套餐相关联的菜品数据
     * @param setmealDish
     */
    void add(SetmealDish setmealDish);

    /**
     * 根据套餐id查询 套餐下面的菜品
     * @param id
     * @return
     */
    List<SetmealDish> findByID(Long id);

    /**
     * 删除 修改时套餐下的菜品
     * @param id
     */
    @Delete("delete from setmeal_dish where setmeal_id=#{id}")
    void deletes(Long id);
}
